package com.youlai.boot.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class Webconfig implements WebMvcConfigurer {

@Override
    public void  addCorsMappings(CorsRegistry corsRegistry){
        corsRegistry.addMapping("api/**")
                .allowedOrigins("http://localhost:8989")
                .allowedMethods("GET","POST","PUT","DELETE")
                .allowedHeaders("*");
    }
}
